
package Phase2;

/**
 * 
 * This interface is for the different NodeStates that a node can be in
 * 
 * @author rpadilla
 * 
 */
public interface NodeState
{
	 
	/**
	 * Returns the highest neighbour or an insertion range 
	 * wherein the insertion point may fall
	 * @param callingNode - the node to goRight() from
	 * @return a NodeOrRange object containing the Node or range of nodes
	 * @pre callingNode != null
	 * @post return instance of NodeOrRange to goRight to
	 */
	public NodeOrRange goRight(Node callingNode, boolean rootAccess) throws InterruptedException;
	
	public boolean lockState(Node callingNode, boolean rootAccess) throws InterruptedException;
	
	/**
	 * checks if the node's state is correctly assigned
	 * @param node checks this node
	 * @return whether it is the correct state or not
	 * @pre node != null, node is of the correct state
	 * @post return true if it is the correct state, otherwise false
	 */
	public boolean assertState(Node node) throws InterruptedException;
}
